package org.jetlinks.pro.rule.engine.device;

import reactor.core.publisher.Mono;

import java.util.Map;

/**
 * 设备告警过滤器,用于判断是否触发告警
 *
 * @author zhouhao
 * @since 1.11
 */
public interface DeviceAlarmFilter {

    DeviceAlarmFilter ALWAYS_ALARM = (rule, data) -> Mono.just(false);

    /**
     * 是否忽略本次告警
     *
     * @param rule 告警规则
     * @param data 告警数据
     * @return 是否忽略
     */
    Mono<Boolean> isIgnoreAlarm(DeviceAlarmRule rule, Map<String, Object> data);

}
